/**
 * @description  : 登录接口服务
 * @descriptionDetail : 登录接口服务
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-10-03 15:19:09
 */

import apiUrl from "@/common/api_urls/common";
import reqHelper from "@/common/reqHelper";
let baseUrl = process.uniEnv.BASE_API;

export default {
  /**
   * 登录接口-调试者
   * @param {*} loginName   登录用户名
   * @returns
   */
  loginDingTest(loginName, pwd, deviceId) { //
    return reqHelper.postForm({ un: loginName, pw: pwd,}, apiUrl.common.login, {deviceId: deviceId,});
  },

  loginDingDing(loginName, pwd, deviceId) { //
    return reqHelper.postForm({ un: loginName, pw: pwd,}, apiUrl.common.loginDingDing, {deviceId: deviceId,});
  },

  loginToken(token, deviceId) { //
    return reqHelper.postForm({ token: token, }, apiUrl.common.loginByToken, {deviceId: deviceId,});
  },
  // 根据Phone登录
  loginMobile(mobile, deviceId) {
    return reqHelper.postForm({ mobile: mobile }, apiUrl.common.loginByMobile, { deviceId: deviceId });
  },
  /**
   * 登录接口 token解析
   * @param {Object} token
   */
  loginByToken(token){
    return reqHelper.postForm({token: token,}, apiUrl.common.loginDing, {});
  },

  // 口令接口调用方法 wumengbo 2023-12-6 开始
  loginAuthCard(authCard) {
    return reqHelper.postJson(authCard, apiUrl.common.authCard, {});
  },
  // 口令接口调用方法 wumengbo 2023-12-6 结束

  /**
   * 获取企微订阅参数
   */
  getWeChatInfo() { //
    return reqHelper.postForm({ }, apiUrl.wechat.getParams, {});
  },

  getAccountInfoWeChat(code) {
    return reqHelper.postForm({ }, `${apiUrl.common.getAccountInfo}?code=${code}`, {});
  },

  weChatSignJsapi(signUrl) {
    return reqHelper.postForm({ }, `${apiUrl.common.weChatSignJsapi}?signUrl=${signUrl}`, {});
  },

  saveAppAccountRel(params) {
    return reqHelper.postForm(
      { thirdPartyUuid: params.thirdPartyUuid, accountUuid: params.accountUuid, },
      apiUrl.common.saveAppAccountRel, {});
  },

  baseUrl:baseUrl,
};
